package com.kawaiior.asoulworld.items.weapon;

import com.kawaiior.asoulworld.items.AsWeaponBase;
import com.kawaiior.asoulworld.util.EntityUtil;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects;
import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.world.World;


public class ItemDianaClassics extends AsWeaponBase {
    public ItemDianaClassics(String name) {
        super(name);
        this.attack_damage = 4f;
        this.max_damage = 32;
    }

    @Override
    public int getMaxItemUseDuration(ItemStack stack) { return 10; }

    @Override
    public EnumAction getItemUseAction(ItemStack stack)
    {
        return EnumAction.NONE;
    }

    @Override
    public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) {
        if (!worldIn.isRemote)
        {
            playerIn.getCooldownTracker().setCooldown(this, 1200);
            EntityUtil.ApplyBuff(playerIn, MobEffects.INSTANT_HEALTH,0,2);
            EntityUtil.ApplyBuff(playerIn,MobEffects.HUNGER,1,20);
            EntityUtil.ApplyBuff(playerIn,MobEffects.FIRE_RESISTANCE,0,20);
            EntityUtil.ApplyBuff(playerIn,MobEffects.WEAKNESS,1,7);
            playerIn.getHeldItem(handIn).damageItem(4, playerIn);
        }
        return super.onItemRightClick(worldIn, playerIn, handIn);
    }

}
